/*
* © 2010 Autodata Solutions Company. All Rights Reserved
* This source code is the confidential and proprietary information of Autodata Solutions Company.
* The user shall not, in whole or in part, copy, publish, disclose or make any use of this source code
* without the prior written consent of Autodata Solutions Company.
*/
Ext.ns('net.autodata.compare');

(function() {

    /**
    * A customized Ext.Button 
    * @class ToolbarButton
    * @extends Ext.Button
    * @namespace net.autodata.compare
    */
    var Button = Ext.extend(Ext.Button, {
        ctCls: 'a-btn-toolbar',
        template: new Ext.Template(
            '<table id="{4}" cellspacing="0" class="x-btn {3}">',
                '<tbody class="{1}">',
                    '<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>',
                    '<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>',
                    '<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',
                    '<tr><td colspan="3" class="a-btn-node-wrap"><b class="select-node"></b></td></tr>',
                '</tbody>',
            '</table>',
            { compile: true, disableFormats: true }
        ),

        /**
        * Button's handler when the enableToggle is set to true, and it is clicked.
        * @method toggleHandler
        * @param {Ext.Button} button this Button object.
        * @param {Boolean} state The next state of the Button, true means pressed.
        * @private
        */
        toggleHandler: function(button, state) {
            var el = button.el;
        }
    });

    net.autodata.compare.ToolbarButton = Button;

    Ext.reg('a-btn-toolbar', net.autodata.compare.ToolbarButton);

})();